package com.voxel.sense.infomsg.module.publish;

import android.view.View;
import android.widget.TextView;

import com.example.com.common.view.recycler.RecyclerAdapter;
import com.voxel.sense.infomsg.R;
import cyy.example.com.facotry.model.api.response.FirmNameByIdEntity;

import butterknife.BindView;

/**
 * Created by ChenYiYao on 2018/9/1.
 */
public class SearchFirmAdapter extends RecyclerAdapter<FirmNameByIdEntity> {

    public SearchFirmAdapter(AdapterListener<FirmNameByIdEntity> listener) {
        super(listener);
    }

    @Override
    protected int getItemViewType(int position, FirmNameByIdEntity o) {
        return R.layout.item_recycler_textview;
    }

    @Override
    protected ViewHolder onCreateViewHolder(View root, int viewType) {
        return new ViewHolder(root);
    }


    static class ViewHolder extends RecyclerAdapter.ViewHolder<FirmNameByIdEntity> {
        @BindView(R.id.iv_desc_icon)
        TextView iv_desc_icon;

        public ViewHolder(View itemView) {
            super(itemView);
        }

        @Override
        protected void onBind(FirmNameByIdEntity firmNameByIdEntity) {
            iv_desc_icon.setText(firmNameByIdEntity.getCompanyName());
        }
    }
}
